package com.lgqz.topsports.adapter;

import android.support.v4.app.Fragment;
import android.support.v4.app.FragmentManager;
import android.support.v4.app.FragmentPagerAdapter;

import com.lgqz.topsports.fragment.BaseFragment;

import java.util.List;

/**
 * Description:
 * Copyright(c) 2016,邱国兴
 * This Program is protected by copyright laws
 * Created by Little Monster on 2016/12/16.
 *
 * @author 邱国兴
 */

public class CommentFragmentPagerAdapter extends FragmentPagerAdapter {
    private List<String> title;

    public CommentFragmentPagerAdapter(FragmentManager fm, List<String> title) {
        super(fm);
        this.title = title;
    }

    @Override
    public Fragment getItem(int position) {

        return BaseFragment.newInstance(title.get(position));
    }

    @Override
    public int getCount() {
        return title.size();
    }

    @Override
    public CharSequence getPageTitle(int position) {
        return title.get(position);
    }
}
